package com;

import com.springboot.bean.Furn;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * @Description:
 * @Author: 张锦波
 * @Date: 2024/8/3 16:19
 * @Version: 1.0
 */
@Controller
@Slf4j
public class hiController {
    @Value("${my.website}")
    private String website;
    //装配到hiController
    @Resource
    private Furn furn;

    @RequestMapping("/hi")
    @ResponseBody
    public String hi() {
        System.out.println("website=" + website);
        return "hi,springboot";
    }
    @RequestMapping("/furn")
    @ResponseBody
    public Furn furn(){
        //使用Slf4j日志输出
        //普通输出
        log.info("furn="+furn);
        //使用占位符进行输出
        log.info("furn1={},furn2={}",furn,furn);
        return furn;
    }
}
